Skip to content

[MOO-1887]: Fix initial slide positioning in IntroScreen widget [MX 11] #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

UrazAkgultan
Copy link
Collaborator

Checklist

  • Contains unit tests ✅
  • Contains breaking changes ❌
  • Compatible with: MX 11
  • Did you update version and changelog? ✅
  • PR title properly formatted ([XX-000]: description)? ✅
  • Works in Android ✅
  • Works in iOS ✅
  • Works in Tablet ✅

This PR contains

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Other (describe)

What is the purpose of this PR?

Currently, when activeSlide is set to a non-zero value, the IntroScreen always opens on the first slide. This happens because the effect that calls scrollToOffset runs too late (or not at all) and its dependency array doesn’t include the slide value/status, so the FlatList never scrolls to the desired index on mount.

@UrazAkgultan UrazAkgultan requested a review from a team as a code owner July 3, 2025 07:12
@UrazAkgultan UrazAkgultan force-pushed the fix/intro-screen-mx11 branch from c523430 to 6bd6983 Compare July 7, 2025 08:19
@@ -71,16 +71,19 @@
"husky": "^8.0.3",
"identity-obj-proxy": "^3.0.0",
"image-js": "^0.35.6",
"jest": "^30.0.4",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has to match the version in @mendix/pluggable-widgets-tools

"lint-staged": "^10.5.4",
"mendix-client": "^7.15.8",
"patch-package": "^8.0.0",
"pixelmatch": "^5.3.0",
"pngjs": "^6.0.0",
"prettier": "^2.8.8",
"pretty-format": "^30.0.2",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this dependency used?

);

useEffect(() => {
const slide = refreshActiveSlideAttribute(props.slides, props.activeSlide);
if (width && props.activeSlide && props.activeSlide.status === ValueStatus.Available && slide !== activeIndex) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use "?." here and skip the "&& props.activeSlide" bit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants